<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>dev: dev::net::SocketApi Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">dev
   &#160;<span id="projectnumber">0.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classdev_1_1net_1_1_socket_api.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classdev_1_1net_1_1_socket_api-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">dev::net::SocketApi Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>本地套接字函数wrapper  
 <a href="classdev_1_1net_1_1_socket_api.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_socket_api_8hpp_source.html">SocketApi.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a468438c9663cdc534e3bf628c29e7c75"><td class="memItemLeft" align="right" valign="top">static sock_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a468438c9663cdc534e3bf628c29e7c75">socket</a> (int domain, int type, int protocol=0)</td></tr>
<tr class="memdesc:a468438c9663cdc534e3bf628c29e7c75"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建一个套接字  <a href="#a468438c9663cdc534e3bf628c29e7c75">More...</a><br /></td></tr>
<tr class="separator:a468438c9663cdc534e3bf628c29e7c75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9e728b6cb0b7932e73acbb250489e25"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#ab9e728b6cb0b7932e73acbb250489e25">bind</a> (sock_t sockfd, const struct sockaddr *addr, socklen_t addrlen)</td></tr>
<tr class="memdesc:ab9e728b6cb0b7932e73acbb250489e25"><td class="mdescLeft">&#160;</td><td class="mdescRight">绑定套接字到指定地址  <a href="#ab9e728b6cb0b7932e73acbb250489e25">More...</a><br /></td></tr>
<tr class="separator:ab9e728b6cb0b7932e73acbb250489e25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0cc819e43ff24147028aecbe7258b08e"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a0cc819e43ff24147028aecbe7258b08e">listen</a> (sock_t sockfd, int backlog)</td></tr>
<tr class="memdesc:a0cc819e43ff24147028aecbe7258b08e"><td class="mdescLeft">&#160;</td><td class="mdescRight">在指定套接字上启动监听  <a href="#a0cc819e43ff24147028aecbe7258b08e">More...</a><br /></td></tr>
<tr class="separator:a0cc819e43ff24147028aecbe7258b08e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2e9851418b2c871852e441f73c1df495"><td class="memItemLeft" align="right" valign="top">static sock_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a2e9851418b2c871852e441f73c1df495">accept</a> (sock_t sockfd, struct sockaddr *addr, socklen_t *addrlen)</td></tr>
<tr class="memdesc:a2e9851418b2c871852e441f73c1df495"><td class="mdescLeft">&#160;</td><td class="mdescRight">接收监听套接字上的连接  <a href="#a2e9851418b2c871852e441f73c1df495">More...</a><br /></td></tr>
<tr class="separator:a2e9851418b2c871852e441f73c1df495"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ac36cc16daf7f35ac40e70fdd52391b"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a4ac36cc16daf7f35ac40e70fdd52391b">connect</a> (sock_t sockfd, const struct sockaddr *addr, socklen_t addrlen)</td></tr>
<tr class="memdesc:a4ac36cc16daf7f35ac40e70fdd52391b"><td class="mdescLeft">&#160;</td><td class="mdescRight">使用指定套接字连接到服务器  <a href="#a4ac36cc16daf7f35ac40e70fdd52391b">More...</a><br /></td></tr>
<tr class="separator:a4ac36cc16daf7f35ac40e70fdd52391b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acab670d7ff1243462f782676d5f26931"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#acab670d7ff1243462f782676d5f26931">close</a> (sock_t sockfd)</td></tr>
<tr class="memdesc:acab670d7ff1243462f782676d5f26931"><td class="mdescLeft">&#160;</td><td class="mdescRight">关闭指定套接字  <a href="#acab670d7ff1243462f782676d5f26931">More...</a><br /></td></tr>
<tr class="separator:acab670d7ff1243462f782676d5f26931"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca13c6bb87f3118f3dd2c008238e3a5a"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#aca13c6bb87f3118f3dd2c008238e3a5a">shutdown</a> (sock_t sockfd, int how)</td></tr>
<tr class="memdesc:aca13c6bb87f3118f3dd2c008238e3a5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">关闭套接字一端  <a href="#aca13c6bb87f3118f3dd2c008238e3a5a">More...</a><br /></td></tr>
<tr class="separator:aca13c6bb87f3118f3dd2c008238e3a5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adea576bbc110685fbf0bd1faa36dd1f6"><td class="memItemLeft" align="right" valign="top">static ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#adea576bbc110685fbf0bd1faa36dd1f6">recvfrom</a> (sock_t sockfd, void *buffer, size_t length, int flags, struct sockaddr *src_addr, socklen_t *addrlen)</td></tr>
<tr class="memdesc:adea576bbc110685fbf0bd1faa36dd1f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">接受数据报  <a href="#adea576bbc110685fbf0bd1faa36dd1f6">More...</a><br /></td></tr>
<tr class="separator:adea576bbc110685fbf0bd1faa36dd1f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74d39e1ca0169a15f8e4cc6c6f9756ab"><td class="memItemLeft" align="right" valign="top">static ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a74d39e1ca0169a15f8e4cc6c6f9756ab">sendto</a> (sock_t sockfd, void *buffer, size_t length, int flags, struct sockaddr *dest_addr, socklen_t addrlen)</td></tr>
<tr class="memdesc:a74d39e1ca0169a15f8e4cc6c6f9756ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">发送数据报  <a href="#a74d39e1ca0169a15f8e4cc6c6f9756ab">More...</a><br /></td></tr>
<tr class="separator:a74d39e1ca0169a15f8e4cc6c6f9756ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5620cca4671a803d43ff11cddd29430"><td class="memItemLeft" align="right" valign="top">static ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#ab5620cca4671a803d43ff11cddd29430">recv</a> (sock_t sockfd, void *buffer, size_t length, int flags)</td></tr>
<tr class="memdesc:ab5620cca4671a803d43ff11cddd29430"><td class="mdescLeft">&#160;</td><td class="mdescRight">接受数据  <a href="#ab5620cca4671a803d43ff11cddd29430">More...</a><br /></td></tr>
<tr class="separator:ab5620cca4671a803d43ff11cddd29430"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6747c98d432dda18d52ca8602d5c024c"><td class="memItemLeft" align="right" valign="top">static ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a6747c98d432dda18d52ca8602d5c024c">send</a> (sock_t sockfd, const void *buffer, size_t length, int flags)</td></tr>
<tr class="memdesc:a6747c98d432dda18d52ca8602d5c024c"><td class="mdescLeft">&#160;</td><td class="mdescRight">发送数据  <a href="#a6747c98d432dda18d52ca8602d5c024c">More...</a><br /></td></tr>
<tr class="separator:a6747c98d432dda18d52ca8602d5c024c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2dadafc2cc647d97ab5091e8dc12195c"><td class="memItemLeft" align="right" valign="top">static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a2dadafc2cc647d97ab5091e8dc12195c">htons</a> (uint16_t host_uint16)</td></tr>
<tr class="memdesc:a2dadafc2cc647d97ab5091e8dc12195c"><td class="mdescLeft">&#160;</td><td class="mdescRight">主机字节序转换为网络字节序  <a href="#a2dadafc2cc647d97ab5091e8dc12195c">More...</a><br /></td></tr>
<tr class="separator:a2dadafc2cc647d97ab5091e8dc12195c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a349f48bfc1f677bc3361a0be8ab47783"><td class="memItemLeft" align="right" valign="top">static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a349f48bfc1f677bc3361a0be8ab47783">htonl</a> (uint32_t host_uint32)</td></tr>
<tr class="memdesc:a349f48bfc1f677bc3361a0be8ab47783"><td class="mdescLeft">&#160;</td><td class="mdescRight">主机字节序转换为网络字节序  <a href="#a349f48bfc1f677bc3361a0be8ab47783">More...</a><br /></td></tr>
<tr class="separator:a349f48bfc1f677bc3361a0be8ab47783"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4dd6d37153baf0f3b28a1a86e9e3513b"><td class="memItemLeft" align="right" valign="top">static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a4dd6d37153baf0f3b28a1a86e9e3513b">ntohs</a> (uint16_t net_uint16)</td></tr>
<tr class="memdesc:a4dd6d37153baf0f3b28a1a86e9e3513b"><td class="mdescLeft">&#160;</td><td class="mdescRight">网络字节序转换为主机字节序  <a href="#a4dd6d37153baf0f3b28a1a86e9e3513b">More...</a><br /></td></tr>
<tr class="separator:a4dd6d37153baf0f3b28a1a86e9e3513b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab645166633b0002c46951033027d022c"><td class="memItemLeft" align="right" valign="top">static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#ab645166633b0002c46951033027d022c">ntohl</a> (uint32_t net_uint32)</td></tr>
<tr class="memdesc:ab645166633b0002c46951033027d022c"><td class="mdescLeft">&#160;</td><td class="mdescRight">网络字节序转换为主机字节序  <a href="#ab645166633b0002c46951033027d022c">More...</a><br /></td></tr>
<tr class="separator:ab645166633b0002c46951033027d022c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a191d49266fd9aa8149240009fa204e98"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a191d49266fd9aa8149240009fa204e98">inet_pton</a> (int domain, const char *src_str, void *addrptr)</td></tr>
<tr class="memdesc:a191d49266fd9aa8149240009fa204e98"><td class="mdescLeft">&#160;</td><td class="mdescRight">转换点分十进制表示的地址为二进制格式  <a href="#a191d49266fd9aa8149240009fa204e98">More...</a><br /></td></tr>
<tr class="separator:a191d49266fd9aa8149240009fa204e98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ae6728572945a50592d06e06ca1681c"><td class="memItemLeft" align="right" valign="top">static const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a3ae6728572945a50592d06e06ca1681c">inet_ntop</a> (int domain, const void *addrptr, char *dst_ptr, size_t len)</td></tr>
<tr class="memdesc:a3ae6728572945a50592d06e06ca1681c"><td class="mdescLeft">&#160;</td><td class="mdescRight">转换二进制格式的地址为点分十进制表示  <a href="#a3ae6728572945a50592d06e06ca1681c">More...</a><br /></td></tr>
<tr class="separator:a3ae6728572945a50592d06e06ca1681c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac30763c26a24cd674efa9e6804d9e448"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#ac30763c26a24cd674efa9e6804d9e448">getaddrinfo</a> (const char *host, const char *service, const struct addrinfo *hints, struct addrinfo **result)</td></tr>
<tr class="memdesc:ac30763c26a24cd674efa9e6804d9e448"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取指定主机名和服务名的套接字地址列表  <a href="#ac30763c26a24cd674efa9e6804d9e448">More...</a><br /></td></tr>
<tr class="separator:ac30763c26a24cd674efa9e6804d9e448"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2139efc71f04f29f6cd6d47217a68fc6"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a2139efc71f04f29f6cd6d47217a68fc6">freeaddrinfo</a> (struct addrinfo *result)</td></tr>
<tr class="memdesc:a2139efc71f04f29f6cd6d47217a68fc6"><td class="mdescLeft">&#160;</td><td class="mdescRight">释放getaddrinfo返回的数据  <a href="#a2139efc71f04f29f6cd6d47217a68fc6">More...</a><br /></td></tr>
<tr class="separator:a2139efc71f04f29f6cd6d47217a68fc6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6137e6bc83ca8599a0e87c7534808c62"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a6137e6bc83ca8599a0e87c7534808c62">getnameinfo</a> (const struct sockaddr *addr, socklen_t addrlen, char *host, size_t hostlen, char *service, size_t servlen, int flags)</td></tr>
<tr class="memdesc:a6137e6bc83ca8599a0e87c7534808c62"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取指定套接字地址的主机名和服务名  <a href="#a6137e6bc83ca8599a0e87c7534808c62">More...</a><br /></td></tr>
<tr class="separator:a6137e6bc83ca8599a0e87c7534808c62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acdaa0a5aadc721422f748f8f931daa53"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#acdaa0a5aadc721422f748f8f931daa53">getsockname</a> (sock_t sockfd, struct sockaddr *addr, socklen_t *addrlen)</td></tr>
<tr class="memdesc:acdaa0a5aadc721422f748f8f931daa53"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取套接字本地地址  <a href="#acdaa0a5aadc721422f748f8f931daa53">More...</a><br /></td></tr>
<tr class="separator:acdaa0a5aadc721422f748f8f931daa53"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb96ed718ee882239929e15f68f4cfa1"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#afb96ed718ee882239929e15f68f4cfa1">getpeername</a> (sock_t sockfd, struct sockaddr *addr, socklen_t *addrlen)</td></tr>
<tr class="memdesc:afb96ed718ee882239929e15f68f4cfa1"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取套接字远程地址  <a href="#afb96ed718ee882239929e15f68f4cfa1">More...</a><br /></td></tr>
<tr class="separator:afb96ed718ee882239929e15f68f4cfa1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a508935c561a3841e65d6a7e794503758"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a508935c561a3841e65d6a7e794503758">getsockopt</a> (sock_t sockfd, int level, int optname, void *optval, socklen_t *optlen)</td></tr>
<tr class="memdesc:a508935c561a3841e65d6a7e794503758"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取套接字选项  <a href="#a508935c561a3841e65d6a7e794503758">More...</a><br /></td></tr>
<tr class="separator:a508935c561a3841e65d6a7e794503758"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebfd2453f8424cebb9dc467d1cea40dd"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#aebfd2453f8424cebb9dc467d1cea40dd">setsockopt</a> (sock_t sockfd, int level, int optname, const void *optval, socklen_t optlen)</td></tr>
<tr class="memdesc:aebfd2453f8424cebb9dc467d1cea40dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置套接字选项  <a href="#aebfd2453f8424cebb9dc467d1cea40dd">More...</a><br /></td></tr>
<tr class="separator:aebfd2453f8424cebb9dc467d1cea40dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8c6ff0f1ef50696e975920048a4ebf9"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#af8c6ff0f1ef50696e975920048a4ebf9">select</a> (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)</td></tr>
<tr class="memdesc:af8c6ff0f1ef50696e975920048a4ebf9"><td class="mdescLeft">&#160;</td><td class="mdescRight">select系统调用  <a href="#af8c6ff0f1ef50696e975920048a4ebf9">More...</a><br /></td></tr>
<tr class="separator:af8c6ff0f1ef50696e975920048a4ebf9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af0cdd3c603edd23ef36f104ef3179394"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#af0cdd3c603edd23ef36f104ef3179394">ioctlsocket</a> (sock_t sock, long cmd, u_long *argp)</td></tr>
<tr class="memdesc:af0cdd3c603edd23ef36f104ef3179394"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置套接字IO模型  <a href="#af0cdd3c603edd23ef36f104ef3179394">More...</a><br /></td></tr>
<tr class="separator:af0cdd3c603edd23ef36f104ef3179394"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14bf28751003dc86e20c60182e771e55"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#a14bf28751003dc86e20c60182e771e55">setsocketnoblocking</a> (sock_t sock, bool on)</td></tr>
<tr class="memdesc:a14bf28751003dc86e20c60182e771e55"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置套接字IO模型  <a href="#a14bf28751003dc86e20c60182e771e55">More...</a><br /></td></tr>
<tr class="separator:a14bf28751003dc86e20c60182e771e55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2941c088aaa168f045e516f1710e54b"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket_api.html#af2941c088aaa168f045e516f1710e54b">setsocketlinger</a> (sock_t sock, bool on)</td></tr>
<tr class="memdesc:af2941c088aaa168f045e516f1710e54b"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置套接字Linger选项  <a href="#af2941c088aaa168f045e516f1710e54b">More...</a><br /></td></tr>
<tr class="separator:af2941c088aaa168f045e516f1710e54b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>本地套接字函数wrapper </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a2e9851418b2c871852e441f73c1df495"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static sock_t dev::net::SocketApi::accept </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct sockaddr *&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">socklen_t *&#160;</td>
          <td class="paramname"><em>addrlen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>接收监听套接字上的连接 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>监听套接字句柄 </td></tr>
    <tr><td class="paramname">addr</td><td>连接的对端地址 </td></tr>
    <tr><td class="paramname">addrlen</td><td>地址长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回套接字句柄，失败返回INVALID_SOCKET </dd></dl>

</div>
</div>
<a class="anchor" id="ab9e728b6cb0b7932e73acbb250489e25"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::bind </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct sockaddr *&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">socklen_t&#160;</td>
          <td class="paramname"><em>addrlen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>绑定套接字到指定地址 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">addr</td><td>需要绑定的地址 </td></tr>
    <tr><td class="paramname">addrlen</td><td>地址长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true </dd></dl>

</div>
</div>
<a class="anchor" id="acab670d7ff1243462f782676d5f26931"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::close </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>关闭指定套接字 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true </dd></dl>

</div>
</div>
<a class="anchor" id="a4ac36cc16daf7f35ac40e70fdd52391b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::connect </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct sockaddr *&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">socklen_t&#160;</td>
          <td class="paramname"><em>addrlen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>使用指定套接字连接到服务器 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">addr</td><td>服务器地址 </td></tr>
    <tr><td class="paramname">addrlen</td><td>地址长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true </dd></dl>

</div>
</div>
<a class="anchor" id="a2139efc71f04f29f6cd6d47217a68fc6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void dev::net::SocketApi::freeaddrinfo </td>
          <td>(</td>
          <td class="paramtype">struct addrinfo *&#160;</td>
          <td class="paramname"><em>result</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>释放getaddrinfo返回的数据 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">result</td><td>要释放的数据 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac30763c26a24cd674efa9e6804d9e448"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::getaddrinfo </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>service</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct addrinfo *&#160;</td>
          <td class="paramname"><em>hints</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct addrinfo **&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取指定主机名和服务名的套接字地址列表 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">host</td><td>主机名 </td></tr>
    <tr><td class="paramname">service</td><td>服务名 </td></tr>
    <tr><td class="paramname">hints</td><td>指定返回的地址标准 </td></tr>
    <tr><td class="paramname">result</td><td>结果 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>失败返回false </dd></dl>

</div>
</div>
<a class="anchor" id="a6137e6bc83ca8599a0e87c7534808c62"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::getnameinfo </td>
          <td>(</td>
          <td class="paramtype">const struct sockaddr *&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">socklen_t&#160;</td>
          <td class="paramname"><em>addrlen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>hostlen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>service</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>servlen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取指定套接字地址的主机名和服务名 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">addr</td><td>套接字地址 </td></tr>
    <tr><td class="paramname">addrlen</td><td>地址长度 </td></tr>
    <tr><td class="paramname">host</td><td>主机名缓存 </td></tr>
    <tr><td class="paramname">hostlen</td><td>缓存长度 </td></tr>
    <tr><td class="paramname">service</td><td>服务名缓存 </td></tr>
    <tr><td class="paramname">servlen</td><td>缓存长度 </td></tr>
    <tr><td class="paramname">flags</td><td>标志 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>失败返回false </dd></dl>

</div>
</div>
<a class="anchor" id="afb96ed718ee882239929e15f68f4cfa1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::getpeername </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct sockaddr *&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">socklen_t *&#160;</td>
          <td class="paramname"><em>addrlen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取套接字远程地址 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">addr</td><td>地址缓存 </td></tr>
    <tr><td class="paramname">addrlen</td><td>地址长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>失败返回false </dd></dl>

</div>
</div>
<a class="anchor" id="acdaa0a5aadc721422f748f8f931daa53"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::getsockname </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct sockaddr *&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">socklen_t *&#160;</td>
          <td class="paramname"><em>addrlen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取套接字本地地址 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">addr</td><td>地址缓存 </td></tr>
    <tr><td class="paramname">addrlen</td><td>地址长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>失败返回false </dd></dl>

</div>
</div>
<a class="anchor" id="a508935c561a3841e65d6a7e794503758"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::getsockopt </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>optname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>optval</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">socklen_t *&#160;</td>
          <td class="paramname"><em>optlen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取套接字选项 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">level</td><td>等级 </td></tr>
    <tr><td class="paramname">optname</td><td>选择名 </td></tr>
    <tr><td class="paramname">optval</td><td>选择值 </td></tr>
    <tr><td class="paramname">optlen</td><td>选择值长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>失败返回false </dd></dl>

</div>
</div>
<a class="anchor" id="a349f48bfc1f677bc3361a0be8ab47783"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint32_t dev::net::SocketApi::htonl </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>host_uint32</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>主机字节序转换为网络字节序 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">host_uint32</td><td>32位变量 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true </dd></dl>

</div>
</div>
<a class="anchor" id="a2dadafc2cc647d97ab5091e8dc12195c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint16_t dev::net::SocketApi::htons </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>host_uint16</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>主机字节序转换为网络字节序 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">host_uint16</td><td>16位变量 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true </dd></dl>

</div>
</div>
<a class="anchor" id="a3ae6728572945a50592d06e06ca1681c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static const char* dev::net::SocketApi::inet_ntop </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>addrptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>dst_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>转换二进制格式的地址为点分十进制表示 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">domain</td><td>套接字所属域 </td></tr>
    <tr><td class="paramname">addrptr</td><td>二进制格式的地址 </td></tr>
    <tr><td class="paramname">dst_ptr</td><td>接收转换后地址缓存 </td></tr>
    <tr><td class="paramname">len</td><td>缓存长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>失败返回NULL </dd></dl>

</div>
</div>
<a class="anchor" id="a191d49266fd9aa8149240009fa204e98"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int dev::net::SocketApi::inet_pton </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>src_str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>addrptr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>转换点分十进制表示的地址为二进制格式 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">domain</td><td>套接字所属域 </td></tr>
    <tr><td class="paramname">src_str</td><td>地址字符串 </td></tr>
    <tr><td class="paramname">addrptr</td><td>接收转换后地址缓存 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回1，地址格式错误返回0，失败返回-1 </dd></dl>

</div>
</div>
<a class="anchor" id="af0cdd3c603edd23ef36f104ef3179394"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int dev::net::SocketApi::ioctlsocket </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_long *&#160;</td>
          <td class="paramname"><em>argp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置套接字IO模型 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sock</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">cmd</td><td>检查读就绪的集合 </td></tr>
    <tr><td class="paramname">argp</td><td>检查写就绪的集合 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回0，失败返回-1 </dd></dl>

</div>
</div>
<a class="anchor" id="a0cc819e43ff24147028aecbe7258b08e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::listen </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>backlog</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>在指定套接字上启动监听 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">backlog</td><td>接受连接队列长度(如果队列满了后续到达的连接会关闭) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true </dd></dl>

</div>
</div>
<a class="anchor" id="ab645166633b0002c46951033027d022c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint32_t dev::net::SocketApi::ntohl </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>net_uint32</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>网络字节序转换为主机字节序 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">net_uint32</td><td>32位变量 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true </dd></dl>

</div>
</div>
<a class="anchor" id="a4dd6d37153baf0f3b28a1a86e9e3513b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint16_t dev::net::SocketApi::ntohs </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>net_uint16</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>网络字节序转换为主机字节序 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">net_uint16</td><td>16位变量 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true </dd></dl>

</div>
</div>
<a class="anchor" id="ab5620cca4671a803d43ff11cddd29430"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ssize_t dev::net::SocketApi::recv </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>接受数据 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">buffer</td><td>缓存 </td></tr>
    <tr><td class="paramname">length</td><td>缓存长度 </td></tr>
    <tr><td class="paramname">flags</td><td>标志 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>发生错误返回-1，数据接收完毕返回EOF，其他情况返回接收的数据长度 </dd></dl>

</div>
</div>
<a class="anchor" id="adea576bbc110685fbf0bd1faa36dd1f6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ssize_t dev::net::SocketApi::recvfrom </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct sockaddr *&#160;</td>
          <td class="paramname"><em>src_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">socklen_t *&#160;</td>
          <td class="paramname"><em>addrlen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>接受数据报 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">buffer</td><td>缓存 </td></tr>
    <tr><td class="paramname">length</td><td>缓存长度 </td></tr>
    <tr><td class="paramname">flags</td><td>标志 </td></tr>
    <tr><td class="paramname">src_addr</td><td>服务器地址 </td></tr>
    <tr><td class="paramname">addrlen</td><td>地址长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>发生错误返回-1，数据接收完毕返回EOF，其他情况返回接收的数据长度 </dd></dl>

</div>
</div>
<a class="anchor" id="af8c6ff0f1ef50696e975920048a4ebf9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int dev::net::SocketApi::select </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>nfds</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">fd_set *&#160;</td>
          <td class="paramname"><em>readfds</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">fd_set *&#160;</td>
          <td class="paramname"><em>writefds</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">fd_set *&#160;</td>
          <td class="paramname"><em>exceptfds</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct timeval *&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>select系统调用 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">nfds</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">readfds</td><td>检查读就绪的集合 </td></tr>
    <tr><td class="paramname">writefds</td><td>检查写就绪的集合 </td></tr>
    <tr><td class="paramname">exceptfds</td><td>检查异常的集合 </td></tr>
    <tr><td class="paramname">timeout</td><td>超时时间 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>失败返回-1，超时返回0，其他情况返回就绪的文件描述符数量 </dd></dl>

</div>
</div>
<a class="anchor" id="a6747c98d432dda18d52ca8602d5c024c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ssize_t dev::net::SocketApi::send </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>发送数据 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">buffer</td><td>缓存 </td></tr>
    <tr><td class="paramname">length</td><td>缓存长度 </td></tr>
    <tr><td class="paramname">flags</td><td>标志 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>发生错误返回-1，其他情况返回发送的数据长度 </dd></dl>

</div>
</div>
<a class="anchor" id="a74d39e1ca0169a15f8e4cc6c6f9756ab"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ssize_t dev::net::SocketApi::sendto </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct sockaddr *&#160;</td>
          <td class="paramname"><em>dest_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">socklen_t&#160;</td>
          <td class="paramname"><em>addrlen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>发送数据报 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">buffer</td><td>缓存 </td></tr>
    <tr><td class="paramname">length</td><td>缓存长度 </td></tr>
    <tr><td class="paramname">flags</td><td>标志 </td></tr>
    <tr><td class="paramname">dest_addr</td><td>服务器地址 </td></tr>
    <tr><td class="paramname">addrlen</td><td>地址长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>发生错误返回-1，其他情况返回发送的数据长度 </dd></dl>

</div>
</div>
<a class="anchor" id="af2941c088aaa168f045e516f1710e54b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::setsocketlinger </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>on</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置套接字Linger选项 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sock</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">on</td><td>是否设置为非阻塞 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true </dd></dl>

</div>
</div>
<a class="anchor" id="a14bf28751003dc86e20c60182e771e55"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::setsocketnoblocking </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>on</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置套接字IO模型 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sock</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">on</td><td>是否设置为非阻塞 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true </dd></dl>

</div>
</div>
<a class="anchor" id="aebfd2453f8424cebb9dc467d1cea40dd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::setsockopt </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>optname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>optval</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">socklen_t&#160;</td>
          <td class="paramname"><em>optlen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置套接字选项 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">level</td><td>等级 </td></tr>
    <tr><td class="paramname">optname</td><td>选择名 </td></tr>
    <tr><td class="paramname">optval</td><td>选择值 </td></tr>
    <tr><td class="paramname">optlen</td><td>选择值长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>失败返回false </dd></dl>

</div>
</div>
<a class="anchor" id="aca13c6bb87f3118f3dd2c008238e3a5a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool dev::net::SocketApi::shutdown </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sockfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>how</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>关闭套接字一端 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sockfd</td><td>套接字句柄 </td></tr>
    <tr><td class="paramname">how</td><td>关闭读|关闭写 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true </dd></dl>

</div>
</div>
<a class="anchor" id="a468438c9663cdc534e3bf628c29e7c75"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static sock_t dev::net::SocketApi::socket </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>protocol</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>创建一个套接字 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">domain</td><td>套接字所属域 </td></tr>
    <tr><td class="paramname">type</td><td>套接字类型(流套接字|数据报套接字) </td></tr>
    <tr><td class="paramname">protocol</td><td>协议类型(0) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回套接字句柄，失败返回INVALID_SOCKET </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>dev/dev/net/<a class="el" href="_socket_api_8hpp_source.html">SocketApi.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>dev</b></li><li class="navelem"><b>net</b></li><li class="navelem"><a class="el" href="classdev_1_1net_1_1_socket_api.html">SocketApi</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
  </ul>
</div>
</body>
</html>
